There Really is Only One Test
Issues of Significance
| statistic | t_df | p_value | alternative | estimate | lower_ci | upper_ci |
|---|---|---|---|---|---|---|
| 1.83 | 49 | 0.04 | greater | 104.46 | 100.37 | Inf |
t <-
iq_scores |>
specify(response = score) |>
calculate(stat = "mean")
null <-
iq_scores |>
specify(response = score) |>
hypothesize(null = "point", mu = 100) |>
generate(reps = 1000, type = "bootstrap") |>
calculate(stat = "mean")
p <- null |> get_p_value(obs_stat = t, direction = "greater")
null |>
visualize() +
shade_p_value(t, direction = NULL, color = "#00A499") +
geom_hline(yintercept = 0, colour = "#333333", linewidth = 1) +
annotate(
"text", x = 95, y = 125,
label = paste0("t = ", round(t, 2), "\n p = ", round(p, 2)),
size = rel(6), color="grey30"
) +
labs(x = "IQ Score", y = NULL, title = NULL)Contact:
Code & Slides:
Paul Johnson // Simulation-Based Hypothesis Testing // Jan 23, 2025